def myFirstFunction():
    print("第一个函数")
    print("啦啦啦")

myFirstFunction()

for i in range(3):
    myFirstFunction()

def mySecondFunction(name):
    print(name+"是帅哥！")
mySecondFunction("姜西京")

def add(num1,num2):
    """
    两参数相加
    :param num1:
    :param num2:
    :return:
    """
    print(num1+num2)
    return num2+num1
a = add(1,4)
b = add("hello","world")
print(a)
print(b)
print(add.__doc__)

#关键字参数  可防止参数顺序放错
def saySomething(name,words):
    print(name + '-->'+words)
saySomething('hello world','abner')
saySomething('abner','hello world')
saySomething(words='hello world',name='abner')

#默认参数，赋予形参默认值
def saySomething2(name='武大郎',words='卖烧饼'):
    print(name + '-->'+words)
saySomething2()
saySomething2(words='不识庐山真面目，只缘身在此山中',name='苏轼')
print(saySomething2())